package it.uai.domainsMigrator;
import org.apache.log4j.Logger;

public class Statistiche implements Runnable {

	private static final Logger logger = Logger.getLogger(Statistiche.class);
	
	Domain dominio;
	Integer statisticsPrintPeriod;

	public Statistiche(Domain dominio, Integer statisticsPrintPeriod) {
		this.dominio = dominio;
		this.statisticsPrintPeriod = statisticsPrintPeriod;
	}

	@Override
	public void run() {

		while (!dominio.isProcessed()) {
			try {
					dominio.printStatistics();
					Thread.sleep(statisticsPrintPeriod);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				logger.debug(e);
			}
		}

	}

}
